﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyOA.DAL;
using MyOA.Model;

namespace MyOA.BLL
{
    public class RoleManageManage
    {
        RoleManageService service = new RoleManageService();

        /// <summary>
        /// 获取全部的角色信息
        /// </summary>
        /// <returns>角色信息</returns>
        public IList<RoleInfo> getAllRoleInfo()
        {
            return service.getAllRoleInfo();
        }

        /// <summary>
        /// 增加角色信息
        /// </summary>
        /// <param name="roleName">要增加的角色名</param>
        /// <returns>增加是否成功</returns>
        public bool insertRoleInfo(string roleName)
        {
            return service.insertRoleInfo(roleName);
        }

        /// <summary>
        /// 根据角色信息ID删除角色信息
        /// </summary>
        /// <param name="roleId">角色信息ID</param>
        /// <returns>是否删除成功</returns>
        public bool deleteRoleInfoByRoleId(int roleId)
        {
            return service.deleteRoleInfoByRoleId(roleId);
        }

        /// <summary>
        /// 根据ID来修改角色信息
        /// </summary>
        /// <param name="roleInfo">角色信息数据源</param>
        /// <returns>返回是否修改成功</returns>
        public bool updateRoleInfoByRoleId(RoleInfo roleInfo)
        {
            return service.updateRoleInfoByRoleId(roleInfo);
        }
    }
}
